package com.hae.shop.micoshoppayservice.mapper;

import com.hae.shop.micoshoppayservice.mapper.model.PayOrgDo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 支付机构数据库交互接口
 */
public interface PayOrgMapper {

    @Select("select t.CHANNEL_ID as payOrgId, t.CHANNEL_NAME as payOrgName, t.CLASS_URL as classUrl, t.SYNC_URL  as syncUrl, t.ASYN_URL as asynUrl " +
            "from payment_channel t WHERE t.CHANNEL_STATE = 1")
    List<PayOrgDo> selectAllPayOrg();

    @Select("select t.CHANNEL_ID as payOrgId, t.CHANNEL_NAME as payOrgName, t.CLASS_URL as classUrl, t.SYNC_URL  as syncUrl, t.ASYN_URL as asynUrl " +
            "from payment_channel t WHERE t.CHANNEL_ID = #{payOrgId} t.CHANNEL_STATE = 1")
    PayOrgDo selectPayOrgById(@Param("payOrgId") String payOrgId);
}
